package xyz.suancaiyu.userservice.client;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;
import xyz.suancaiyu.userservice.client.hystrix.AuthServiceHystrix;
import xyz.suancaiyu.userservice.entity.JWT;

/**
 * @author puruidong
 * @version 2019/1/24 22:32
 */
@FeignClient(value="uaa-service",fallback = AuthServiceHystrix.class)
public interface AuthServiceClient {

    @PostMapping(value = "/oauth/token")
    JWT getToken(@RequestHeader(value = "Authorization") String authorization, @RequestParam("grant_type") String type,
                 @RequestParam("username") String username, @RequestParam("password") String password);

}
